﻿<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >

	<!-- ListBox -->

	<Style x:Key="{x:Type ListBox}" TargetType="{x:Type ListBox}">
		<Setter Property="SnapsToDevicePixels" Value="true"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
		<Setter Property="Foreground" Value="{DynamicResource VOColor1A}"/>
		<Setter Property="FocusVisualStyle" Value="{x:Null}" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ListBox}">
					<ScrollViewer
					  Margin="1"
					  Focusable="False">
						<StackPanel IsItemsHost="True" />
					</ScrollViewer>
					<ControlTemplate.Triggers>
						<!--Trigger Property="IsEnabled" Value="false">
							<Setter TargetName="Border" Property="Background" Value="#FF5F5E5D" />
						</Trigger-->
						<Trigger Property="IsGrouping" Value="true">
							<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<!-- ListBoxItem -->

	<Style x:Key="{x:Type ListBoxItem}" TargetType="{x:Type ListBoxItem}">
		<Setter Property="SnapsToDevicePixels" Value="true"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="FocusVisualStyle" Value="{x:Null}" />
		<Setter Property="Foreground" Value="{DynamicResource VOColor10}" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ListBoxItem}">
					<Grid Margin="1,1,1,1">
						<Border
						  Name="highlight"
						  CornerRadius="1,1,1,1"
						  HorizontalAlignment="Stretch"
						  VerticalAlignment="Stretch"
						  Background="{DynamicResource VOColor02}"
						  Opacity="0"/>
						<Border
						  Name="selection"
						  CornerRadius="1,1,1,1"
						  HorizontalAlignment="Stretch"
						  VerticalAlignment="Stretch"
						  Background="{DynamicResource VOColor01}"
						  Opacity="0"/>
						<Border Padding="2,2,2,2" Margin="1,1,1,1">
							<ContentPresenter/>
						</Border>
					</Grid>
					<ControlTemplate.Triggers>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsMouseOver" Value="True"/>
							</MultiTrigger.Conditions>
							<MultiTrigger.EnterActions>
								<BeginStoryboard>
									<Storyboard>
										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="highlight">
											<SplineDoubleKeyFrame Value="0" KeyTime="00:00:00"/>
											<SplineDoubleKeyFrame Value="1" KeyTime="00:00:00.1750000"/>
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</BeginStoryboard>
							</MultiTrigger.EnterActions>
							<MultiTrigger.ExitActions>
								<BeginStoryboard>
									<Storyboard>
										<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="highlight">
											<SplineDoubleKeyFrame Value="0" KeyTime="00:00:00.25"/>
										</DoubleAnimationUsingKeyFrames>
									</Storyboard>
								</BeginStoryboard>
							</MultiTrigger.ExitActions>
						</MultiTrigger>
						<Trigger Property="IsSelected" Value="true">
							<Setter TargetName="selection" Property="Opacity" Value="1"/>
						</Trigger>
						<!--Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
						</Trigger-->
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

</ResourceDictionary>